package di

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/customer"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/file"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/message"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/mini_program"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/site_announcement"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/strategic_monitor"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/tenant"

	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/organization"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/server/report"
	user2 "git.mycaigou.com/gfyx/micro-gfyx-user-service/server/user"
)

func (c *inject) InjectServer() {
	servers := []interface{}{
		file.NewFileServer,
		message.NewVerifyCode,
		organization.NewOrganization,
		report.NewReport,
		mini_program.NewMiniProgramServer,
		tenant.NewTenantServer,
		tenant.NewCreateTenantServer,
		user2.NewUserInfo,
		user2.NewUserLogin,
		customer.NewCustomerGroupServer,
		strategic_monitor.NewStrategicMonitorServer,
		site_announcement.NewSiteAnnouncementServer,
	}
	var errs []error
	for _, repo := range servers {
		err := c.Provide(repo)
		if err != nil {
			errs = append(errs, err)
		}
	}
	fmt.Printf("InjectServer errors:#%+v\n", errs)
}
